package com.micro.service.model;

import org.springframework.data.annotation.Transient;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Create by Vic Xu on 2019/3/6
 */
public class UserInfo{

    private String id;

    private String name;

    private int age;

    private String sex;

    private String mail;

    private Date createDate;

    public UserInfo() {
        createDate = new Date();
    }

    public UserInfo(String id, String name, int age, String sex, String mail) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.mail = mail;
        this.createDate = new Date();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @Transient
    public String getDateStr() {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return format.format(createDate);
    }

}
